home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0038_Get GREATER of Integers.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  786b  |  25 lines

  1. {*****************************************************************************
  2.  * Function ...... MaxI()
  3.  * Purpose ....... To return the greater of two integers
  4.  * Parameters .... nNum1, nNum2     The integers to compare
  5.  * Returns ....... The greater of nNum1 and nNum2
  6.  * Notes ......... None
  7.  * Author ........ Martin Richardson
  8.  * Date .......... September 30, 1992
  9.  *****************************************************************************}
  10. FUNCTION MaxI( nNum1, nNum2: LONGINT ): LONGINT; ASSEMBLER;
  11. ASM
  12.      MOV  AX, WORD PTR nNum1[0]
  13.      MOV  DX, WORD PTR nNum1[2]
  14.      CMP  DX, WORD PTR nNum2[2]
  15.      JNLE @@2
  16.      JL   @@1
  17.  
  18.      CMP  AX, WORD PTR nNum2[0]
  19.      JA   @@2
  20.  
  21. @@1: MOV  AX, WORD PTR nNum2[0]
  22.      MOV  DX, WORD PTR nNum2[2]
  23. @@2:
  24. END;
  25.